package com.demo.ctf;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;

public class FutureThenApplyDemo {
    public static void main(String[] args) throws Exception {

        CompletableFuture<String> orgFuture = CompletableFuture.supplyAsync(
                ()->{
                    System.out.println("原始CompletableFuture方法任务");
                    return "1.supplyAsync";
                }
        );

        CompletableFuture<String> thenApplyFuture = orgFuture.thenApply((a) -> {
            return a+ ",2.thenApply";
        });

        System.out.println(thenApplyFuture.get());
    }
}


